package com.ambow.dao.impl;

import java.util.List;

import com.ambow.dao.MessageDao;
import com.ambow.entity.Message;
import com.ambow.utils.BaseDAO;
import com.ambow.utils.PageResults;

public class MessageDaoImpl implements MessageDao {

	@Override
	public  boolean saveMessage(Message message) {
		return BaseDAO.add(message);
	}

	@Override
	public List<Message> selectAllMessage() {
	String hql="from Message where status=1";
		return BaseDAO.queryAll(hql);
	}

	@Override
	public PageResults<Message> getPageByFetchedHql(String hql, String countHql, Integer pageNo, Integer pageSize) {
		return BaseDAO.getPageByFetchedHql(hql, countHql, pageNo, pageSize);
	}

	@Override
	public Message queryById(Class c, int id) {
		return (Message) BaseDAO.get(c, id);
		
		
	}
	

}
